<?php

namespace app\backend\validate;

use think\Validate;

class Account extends Validate
{
    protected $rule = [
        'username' => 'require',
        'password' => 'require',
        'code' => 'require|captcha',
        'update_password' => 'require',
        'repeat_password' => 'require|confirm:update_password'
    ];
    protected $message = [
        'username.require' => '请输入用户名',
        'password.require' => '请输入密码',
        'code.require' => '请输入验证码',
        'code.captcha' => '验证码不正确',
        'update_password.require' => '请输入新密码',
        'repeat_password.require' => '请输入重复的新密码',
        'repeat_password.confirm' => '新密码和重复密码不匹配'
    ];
    protected $scene = [
        'login' => ['username', 'password', 'code'],
        'reg'   => ['username', 'password'],
        'pass'  => ['password', 'update_password', 'repeat_password']
    ];
}